public class Animal {
    String name;
    int age;

    public Animal(String name,int age) {
        this.name = name;
        this.age = age;
    }

    public void eat() {
        System.out.println(name + "吃饭~");
    }

    public void sleep() {
        System.out.println(name + "正在睡觉！");
    }
}

class Cat extends Animal {
    public Cat(String name,int age) {
        super(name,age);
    }

    public void eat() {
        System.out.println(name + "吃鱼~");
    }

    public void sleep1() {
        sleep(cat);
    }
}

class Dog extends Animal {
    public Dog(String name,int age) {
        super(name,age);
    }

    public void eat() {
        System.out.println(name + "吃骨头~");
    }
}

class TestAnimal {
    public static void eat(Animal a) {
        a.eat();
    }

    public static void main(String[] args) {
        Cat cat = new Cat("喵喵",5);
        Dog dog = new Dog("旺财",6);

        eat(cat);
        eat(dog);
    }
}